﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Input;
using System.Windows.Controls;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class UIKSL : ViewBase
    {
        public VKSLEIST TMV
        {
            get
            {
                return (VKSLEIST)MV;
            } 
        } 
        #region ==AMVKEY===========
        public static readonly DependencyProperty AMVKEYProperty = DependencyProperty.Register("AMVKEY",
        typeof(string), typeof(UIKSL),
        new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMVKEYChanged));
        public string AMVKEY
        {
            get
            {
                return (string)GetValue(AMVKEYProperty);
            }
            set
            {
                SetValue(AMVKEYProperty, value);
            }
        }
        private static void OnAMVKEYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIKSL;
            if (src != null)
            {
                src.AMVKEY = (string)e.NewValue;
            }
        }
        #endregion
        public UIKSL()
        { 
             
        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            base.Window_Loaded(sender, e);
        }
       
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e); 
            if (dwMaster == null)
            {
                KEY = "";
            }
            else
            {
                KEY = TMV.KSLAUFKRS+TMV.KSLAUFLFD+TMV.KSLAUFPOS+TMV.KSLAFOLGE+TMV.KSLAENDZL;
            } 
        }
        
    }
}
